package leetcode.hot100;

import common.TreeNode;

/**
 * Created on 2021/1/6 。
 *  翻转二叉树
 * @author wll 1978992154@qq.com
 */
public class InvertTwoTree {

    /**
     * 翻转一颗二叉树
     * @param root 树的根节点
     * @return 翻转后的二叉树
     */
    public static TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode left = invertTree(root.left);
        TreeNode right = invertTree(root.right);
        root.left = right;
        root.right = left;
        return root;
    }

    public static void main(String[] args) {



    }
}
